package cntv.player.engine;

/**
 * 常量类
 * @author zengliang
 *
 */
public class Const {
	
	public static final String URLPRE = "cntvmedia";
	
	/**
	 * 默认半屏时，播放器视图宽高比4:3,
	 * 相对ASPECT_RATIO_LARGE，高度更大
	 */
	public static final float ASPECT_RATIO_SMALL = 4/3f;
	/**
	 * 播放器视图宽高比16:9
	 * 相对ASPECT_RATIO_SMALL，高度更小
	 */
	public static final float ASPECT_RATIO_LARGE = 16/9f;
	
	/**
	 * 开关控制，代表关闭
	 */
	public static final int CLOSE = 0;
	/**
	 * 开关控制 ，代表开启
	 */
	public static final int  OPEN= 1;

	/**
	 * 点播
	 */
	public static final int VOD = 100;
	/**
	 * 直播
	 */
	public static final int LIVE = 101;
	/**
	 * 点播缓存
	 */
	public static final int VODCACHE = 102;
	
	/**
	 * 播放类型，竖屏，半屏
	 */
	public static final int PLAY_TYPE_PORT = 1;
	/**
	 * 播放类型，横屏，全屏
	 */
	public static final int PLAY_TYPE_LAND = 2;
	/**
	 * 播放类型，右下角小屏
	 */
	public static final int PLAY_TYPE_RBC = 3;
	
	/**
	 * 主配置地址
	 */
	public static final String BASE_PATH = "http://serv.cbox.cntv.cn/json/qita/yidongzhupeizhi/index.json";
	
	/**
	 * 直播策略访问地址
	 */
	public static final String LIVE_POLICY_PATH = "http://cn.player.cntv.cn/liveconfig/live.app";
	
	
	public static final String CACHE_PATH_NAME= "cntvplay";
	public static final String CACHE_VIDEO_PATH_NAME= "cntvvideo";
	public static final String DB_NAME = "cntvPlayDb.db";
	
	
	
	//Share_pref中存储信息的key值
	/**
	 * 主配置信息key值
	 */
	public static final String SHAR_PREF_KEY_CONFIG = "key_config";
	/**
	 * 广告信息key值
	 */
	public static final String SHAR_PREF_KEY_AD = "key_ad";
	/**
	 * 直播策略信息key值
	 */
	public static final String SHAR_PREF_KEY_LIVE_POLICY = "key_live_policy";
	
	//日期类型
	public static final String DATE_TYPE_YMD = "yyyyMMdd";
	public static final String DATE_TYPE_YMDHMS = "yyyyMMdd HH:mm:ss";
	public static final String DATE_TYPE_Y_M_DHMS = "yyyy-MM-dd HH:mm:ss";
	
	//播放控制器上相关按钮名称
	/**
	 * 未显示列表
	 */
	public static final String TAG_NULL = "defalut_tag";
	/**
	 * 直播显示推荐列表
	 */
	public static final String TAG_RECO = "recommend";
	/**
	 * 直播显示频道列表
	 */
	public static final String TAG_CHAN = "channel";
	/**
	 * 直播显示epg列表
	 */
	public static final String TAG_EPG = "epg";
	/**
	 * 点播显示选集列表 
	 */
	public static final String TAG_EPI = "epiSelect";
	
	/**
	 * 点播显示精集列表 
	 */
	public static final String TAG_BEST = "bestSelect";
	/**
	 * 点播显示详情列表 
	 */
	public static final String TAG_DETA = "detail";
	
	
	// 码率,值对应码率地址中的 {xxx}.m3u8
	/**
	 * 极速模式,200.m3u8
	 */
	public static final int PLAYER_MODE_TS = 200;
	/**
	 * 标清模式,450.m3u8
	 */
	public static final int PLAYER_MODE_SD = 450;
	/**
	 * 高清模式,850.m3u8
	 */
	public static final int PLAYER_MODE_HD = 850;
	/**
	 * 超清模式,1200.m3u8
	 */
	public static final int PLAYER_MODE_PD = 1200;
	/**
	 * 超高清模式,2000.m3u8
	 */
	public static final int PLAYER_MODE_UHD = 2000;
	/**
	 * 自适应模式,用于直播
	 */
	public static final int PLAYER_MODE_AUTO = 205;
	
	
	//时移相关常量
	public static final int TIME_SHIFT_FOR_SECOND = 300;
	public static final int TIME_SHIFT_FOR_HOUR = 301;
	public static final int TIME_SHIFT_FOR_DAY = 302;
	
	//播放错误类型
	/**
	 * 网络异常
	 */
	public static final int ERROR_NET_EXCEPTION = 501;
	/**
	 * 访问超时异常
	 */
	public static final int ERROR_TIMEOUT_EXCEPTION = 502;

	/**
	 * 视频播放异常
	 */
	public static final int ERROR_PLAY_EXCEPTION = 503;
	/** * 请求地址为空 */
	public static final int ERROR_REQUEST_NULL = 5031;
	/** * 返回信息为空*/
	public static final int ERROR_RESPONSE_NULL = 5032;
	/** * 返回数据异常*/
	public static final int ERROR_DATA_EXCEPTION = 5033;

	/**
	 * 版权保护，等于504，同p2p播放 版权保护错误时 返回值一致
	 */
	public static final int ERROR_INVALID_COPYRIGHT = 504;
	/**
	 * 广告显示异常
	 */
	public static final int ERROR_AD_EXCEPTION = 505;
	

	
	/**
	 * 设置此类型，广告地址从常量中获取,所有视频均播放广告，无 后贴片广告
	 */
	public static final String AD_MODE_OVER = "ad_mode_over";
	/**
	 * 设置此类型，广告地址从服务器获取,根据视频相关参数确定是否播放广告
	 */
	public static final String AD_MODE_POINT = "ad_mode_point";
	public static final String AD_CNTV_YUEDONG = "cntv_yangshiyuedong";
	public static final String AD_CNTV_TIYU = "cntv_yangshitiyu";
	//广告类型
	/**
	 * 播放前广告
	 */
	public static final int AD_CALL = 500;
	/**
	 * 暂停图片
	 */
	public static final int AD_PAUSE = 501;
	/**
	 * 点播播放完成广告
	 */
	public static final int AD_AFTER = 502;
	//广告地址替换
	public static final String RANDOM = "{random}";
	public static final String RANDOM_ = "random";
	public static final String CATALOG = "{catalog}";
	public static final String CATALOG_ = "catalog";
	public static final String VIDEOSETID = "{videosetid}";
	public static final String VIDEOSETID_ = "videosetid";
	public static final String VIDEOID = "{videoid}";
	public static final String VIDEOID_ = "videoid";
	public static final String DURATION = "{duration}";
	public static final String DURATION_ = "duration";
	public static final String CHANNEL = "{channel}";
	public static final String CHANNEL_ = "channel";
	public static final String PROJECT = "{project}";
	public static final String PROJECT_= "project";
	
	/**
	 * p2p地址前缀,用来切割p2p地址获取channelId
	 * pa://cctv_p2p_hdcctv5
	 */
	public static final String P2P_URL_PREFIX = "pa://cctv_p2p_hd";

	// 配置地址的key值
	/**
	 * 获取直播各频道分类列表url的key值
	 * 
	 * http://serv.cbox.cntv.cn/json/zhibo/pindaodaohang/index.json
	 * 
	 */
	public static final String KEY_CHAN_URL = "zhibo_index";
	
	/**
	 * 自动获取频道列表图片url 的key值
	 * value地址 + "cctv13_01.png?rdm=null"
	 * http://t.live.cntv.cn/imagehd/cctv13_01.png?rdm=null
	 */
	public static final String KEY_AUTOIMG_URL = "autoimg_url";
	/**
	 * 当前频道正在播放的节目信息url 的key值
	 * value地址 + "&c=cctv13"
	 * http://api.cntv.cn/epg/nowepg?serviceId=cbox&c=cctv13
	 */
	public static final String KEY_LIVING_URL = "living_url";
	
	/**
	 * 当前频道推荐列表 地址的key值
	 * value地址 + "&channel=cctv13&p=1&n=100"
	 * http://api.cntv.cn/videoset/vsetlist?serviceId=cbox&lanmu=1&channel=cctv13&p=1&n=100
	 */
	public static final String KEY_RECOM_URL = "lanmu_url";
	
	/**
	 * 当前频道直播epg列表地址的key值 
	 * value地址 +  "?c=cctv13&d=0"
	 * http://tv.cntv.cn/api/epg/info2?c={channelId}&d=0
	 * http://tv.cntv.cn/api/epg/info2?c=cctv13&d=0
	 * 
	 */
	public static final String KEY_EPG_URL = "sjepg_url";
	/**
	 * 当前频道直播epg列表地址的前缀
	 * value地址 +  "?c=cctv13&d=0"
	 * http://tv.cntv.cn/api/epg/info2?c={channelId}&d=0
	 * http://tv.cntv.cn/api/epg/info2?c=cctv13&d=0
	 * 
	 */
	public static final String PRE_EPG_URL = "http://tv.cntv.cn/api/epg/info2?d=0&";
	
	/**
	 * vdn直播地址的 key值 地址后面接p2pUrl
	 * value地址 + "?channel=pa://cctv_p2p_hdcctv13&client=androidapp"
	 * http://vdn.live.cntv.cn/api2/live.do?channel={p2pUrl}&client=androidapp
	 * http://vdn.live.cntv.cn/api2/live.do?channel=pa://cctv_p2p_hdcctv13&client=androidapp
	 * 
	 */
	public static final String KEY_VDN_URL = "zbvdn_url";
	/**
	 * vdn直播地址的前缀 地址后面接p2pUrl
	 * value地址 + "?channel=pa://cctv_p2p_hdcctv13&client=androidapp"
	 * http://vdn.live.cntv.cn/api2/live.do?channel={p2pUrl}&client=androidapp
	 * http://vdn.live.cntv.cn/api2/live.do?channel=pa://cctv_p2p_hdcctv13&client=androidapp
	 * 
	 */
	public static final String PRE_VDN_URL = "http://vdn.live.cntv.cn/api2/live.do?client=androidapp&";
	
	
	/**
	 * 点播分类 地址的 key值  
	 */
	public static final String KEY_VOD_CATE = "dianbo_index";
	
	/**
	 * 点播分类详情 地址的 key值  地址后面接cid
	 * "&cid=CN06&n=20&p=1"
	 */
	public static final String KEY_VOD_DETAIL = "vset_url";
	
	/**
	 * 点播视频地址的 key值  地址后面接pid(vid)
	 * "pid=cb5c152401444204b25a026f971c819f"
	 * http://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid={pid}
	 * http://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid=cb5c152401444204b25a026f971c819f
	 */
	public static final String KEY_VOD_URL = "dianbo_url";//地址后面接"pid=cb5c152401444204b25a026f971c819f"
	
	/**
	 * 点播视频地址的前缀  地址后面接pid(vid)
	 * "pid=cb5c152401444204b25a026f971c819f"
	 * http://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid={pid}
	 * http://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?pid=cb5c152401444204b25a026f971c819f
	 */
	public static final String PRE_VOD_URL = "http://vdn.apps.cntv.cn/api/getHttpVideoInfo.do?";
	/**
	 * 点播列表播放地址的 key值 地址后面接vsid
	 * "&vsid=VSET100187618898"
	 * http://api.cntv.cn/video/videolistById?serviceId=cbox&vsid=VSET100187618898
	 */
	public static final String KEY_VLIST_URL = "vlist_url";
	
	/**
	 * 广告地址信息的 key值
	 * http://www.cntv.cn/nettv/adp/online/adlist_android.js
	 */
	public static final String KEY_AD_URL = "adandroid_url";
	/**
	 * 广告地址
	 * http://www.cntv.cn/nettv/adp/online/adlist_android.js
	 */
	public static final String PRE_AD_URL = "http://www.cntv.cn/nettv/adp/online/adlist_android.js";
	
	/**
	 * 央视体育启动广告地址
	 */
	public static final String AD_LAUNCHER_URL = "http://pubads.g.doubleclick.net/gampad/adx?iu=/8962/{project}/APHONE_QIDONGYE&sz=1x1&c={random}&m=text/plain";
	/**
	 * 央视体育直播暂停广告地址
	 * http://pubads.g.doubleclick.net/gampad/adx?iu=/8962/cntv_yangshitiyu/APHONE_ZHIBO_ZANTING&sz=1x1&c=2342&t=channelid=pa://cctv_p2p_hdcctv5&m=text/plain
	 */
	public static final String AD_LIVE_PAUSE_URL = "http://pubads.g.doubleclick.net/gampad/adx?iu=/8962/{project}/APHONE_ZHIBO_ZANTING&sz=1x1&c={random}&t=channelid%3D{channel}&m=text/plain";
	/**
	 * 央视体育直播前贴片广告地址1
	 */
	public static final String AD_LIVE_CALL_URL1 = "http://pubads.g.doubleclick.net/gampad/adx?iu=/8962/{project}/APHONE_ZHIBO_QIANTIE_1&sz=7x1&c={random}&t=channelid%3D{channel}&m=text/plain";
	/**
	 *  央视体育直播前贴片广告地址2
	 */
	public static final String AD_LIVE_CALL_URL2 = "http://pubads.g.doubleclick.net/gampad/adx?iu=/8962/{project}/APHONE_ZHIBO_QIANTIE_2&sz=7x2&c={random}&t=channelid%3D{channel}&m=text/plain";
	
	/**
	 * 央视体育点播暂停广告地址
	 */
	public static final String AD_VOD_PAUSE_URL = "http://pubads.g.doubleclick.net/gampad/adx?iu=/8962/{project}/APHONE_DIANBO_ZANTING&sz=1x1&c={random}&m=text/plain";
	/**
	 * 央视体育点播前贴片广告地址1
	 */
	public static final String AD_VOD_CALL_URL1 = "http://pubads.g.doubleclick.net/gampad/adx?iu=/8962/{project}/APHONE_DIANBO_QIANTIE_1&sz=7x1&c={random}&m=text/plain";
	/**
	 *  央视体育点播前贴片广告地址2
	 */
	public static final String AD_VOD_CALL_URL2 = "http://pubads.g.doubleclick.net/gampad/adx?iu=/8962/{project}/APHONE_DIANBO_QIANTIE_2&sz=7x2&c={random}&m=text/plain";
	
}
